package cate.game.role.res.guild.msg.rank;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdGuild;
import cate.game.role.Role;

@ClientMsg(title = "公会排名的请求")
public class GuildRankReq implements MsgInput {
    @Override
    public MsgConfig conf() {
        return MsgIdGuild.GUILD_RANK_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        Role role = cc.getRole();
        if (!role.getRes().guild.checkGuild().ok()) {
            role.getGame().res.guild.sendRankResp(role);
        } else {
            role.getRes().guild.getGuild().rankPO.sendRankResp(role);
        }
    }
}
